package com.example.flex.config;

import com.example.flex.BaseDO;
import com.mybatisflex.annotation.UpdateListener;

import java.time.LocalDateTime;

public class BaseDOUpdateListener implements UpdateListener {


    @Override
    public void onUpdate(Object entity) {
        if (entity instanceof BaseDO baseDO) {
            baseDO.setUpdateTime(LocalDateTime.now());
        }

    }
}
